package com.example.behaviorpattern.state.impl;


import com.example.behaviorpattern.state.MusicPlayer;
import com.example.behaviorpattern.state.PlayerState;


/**
 * 具体状态类：暂停状态
 *
 * @author yaojianfeng
 */
public class PausedState implements PlayerState {
    @Override
    public void play(MusicPlayer context) {
        System.out.println("从暂停状态恢复音乐播放。");
        context.setState(new PlayingState());
    }

    @Override
    public void stop(MusicPlayer context) {
        System.out.println("停止音乐播放。");
        context.setState(new StoppedState());
    }

    @Override
    public void pause(MusicPlayer context) {
        System.out.println("音乐已经处于暂停状态。");
    }
}